package com.appwoo.txtws.app;

import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.app.TabActivity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import com.appwoo.txtws.component.Logger;
import com.appwoo.txtws.wheel.widget.WidgetDialogHelper;
import java.util.concurrent.atomic.AtomicBoolean;

public abstract class AppTabActivity extends TabActivity
{
  protected String _TAG = AppTabActivity.class.getSimpleName();
  protected boolean isExit = false;
  protected AtomicBoolean isLock = new AtomicBoolean(false);
  protected ProgressDialog mProgressDialog;
  private TextView tvBarTitle;

  public void IntentActivity(Context paramContext, Class<?> paramClass)
  {
    startActivity(new Intent(paramContext, paramClass));
  }

  public void IntentActivity(Context paramContext, Class<?> paramClass, Bundle paramBundle)
  {
    Intent localIntent = new Intent(paramContext, paramClass);
    Bundle localBundle = new Bundle();
    if (paramBundle != null)
      localBundle.putAll(paramBundle);
    localIntent.putExtras(localBundle);
    startActivity(localIntent);
  }

  protected void alertMessage(String paramString)
  {
    App.toast(paramString);
  }

  protected void alertMessageShort(String paramString)
  {
    App.toast(paramString, 0);
  }

  protected void backKeyCallBack()
  {
  }

  protected void closeProgress()
  {
    if (this.mProgressDialog != null)
    {
      this.mProgressDialog.dismiss();
      this.mProgressDialog = null;
    }
  }

  protected void dialog(String paramString1, String paramString2, DialogInterface.OnClickListener paramOnClickListener)
  {
    dialog(paramString1, paramString2, "Yes", "No", paramOnClickListener);
  }

  protected void dialog(String paramString1, String paramString2, String paramString3, String paramString4, DialogInterface.OnClickListener paramOnClickListener)
  {
    App.buildDialog().setTitle(paramString1).setMessage(paramString2).setPositiveButton(paramString3, paramOnClickListener).setNegativeButton(paramString4, new DialogInterface.OnClickListener()
    {
      public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
      {
      }
    }).show();
  }

  public void exitApp()
  {
    super.onBackPressed();
    this.isExit = true;
  }

  protected ImageButton findImageButton(int paramInt)
  {
    ImageButton localImageButton = (ImageButton)findViewById(paramInt);
    UIStyle.setButtonFocusChanged(localImageButton);
    return localImageButton;
  }

  protected ImageButton findImageButton(View paramView, int paramInt)
  {
    ImageButton localImageButton = (ImageButton)paramView.findViewById(paramInt);
    UIStyle.setButtonFocusChanged(localImageButton);
    return localImageButton;
  }

  protected void hideBarBack()
  {
    findViewById(2131492864).findViewById(2131493275).setVisibility(4);
  }

  protected void hideBarHome()
  {
    findViewById(2131492864).findViewById(2131493278).setVisibility(4);
  }

  protected boolean isLock()
  {
    return this.isLock.get();
  }

  protected void lock()
  {
    this.isLock.set(true);
  }

  protected void logDebug(String paramString)
  {
    Logger.d(this._TAG, paramString);
  }

  protected void logError(String paramString)
  {
    Logger.e(this._TAG, paramString);
  }

  protected void logError(String paramString, Throwable paramThrowable)
  {
    Logger.e(this._TAG, paramString, paramThrowable);
  }

  protected void logInfo(String paramString)
  {
    Logger.i(this._TAG, paramString);
  }

  protected void logVerbose(String paramString)
  {
    Logger.v(this._TAG, paramString);
  }

  protected void logWarning(String paramString)
  {
    Logger.w(this._TAG, paramString);
  }

  protected void menuKeyCallBack()
  {
  }

  public void onBackPressed()
  {
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    this._TAG = getClass().getSimpleName();
    if (isChild());
    for (Object localObject = getParent(); ; localObject = this)
    {
      App.initAppContext((Activity)localObject);
      logInfo("onCreate");
      return;
    }
  }

  protected void onDestroy()
  {
    logInfo("onDestroy");
    super.onDestroy();
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    super.onKeyDown(paramInt, paramKeyEvent);
    switch (paramInt)
    {
    default:
    case 82:
    case 4:
    }
    while (true)
    {
      return false;
      logInfo("Press Menu Key");
      menuKeyCallBack();
      continue;
      logInfo("[App]Press Back Key");
      backKeyCallBack();
    }
  }

  protected void onPause()
  {
    logInfo("onPause");
    super.onPause();
  }

  protected void onResume()
  {
    logInfo("onResume");
    super.onResume();
  }

  protected void onStart()
  {
    logInfo("onStart");
    super.onStart();
  }

  protected void onStop()
  {
    logInfo("onStop");
    super.onStop();
  }

  protected void setBarBackOnClickListener(View.OnClickListener paramOnClickListener)
  {
    findViewById(2131492864).findViewById(2131493276).setOnClickListener(paramOnClickListener);
  }

  protected void setBarHomeBtnOnClickListener(View.OnClickListener paramOnClickListener)
  {
    findViewById(2131492864).findViewById(2131493279).setOnClickListener(paramOnClickListener);
  }

  protected void setBarHomeDrawable(Drawable paramDrawable)
  {
    ((ImageView)findViewById(2131492864).findViewById(2131493280)).setImageDrawable(paramDrawable);
  }

  protected void setBarHomeOnClickListener(View.OnClickListener paramOnClickListener)
  {
    findViewById(2131492864).findViewById(2131493280).setOnClickListener(paramOnClickListener);
  }

  protected void setBarHomeText(String paramString)
  {
    ((Button)findViewById(2131492864).findViewById(2131493279)).setText(paramString);
  }

  protected void setBarTitle(String paramString)
  {
    this.tvBarTitle = ((TextView)findViewById(2131492864).findViewById(2131493277));
    this.tvBarTitle.setText(paramString);
  }

  protected void setLeftBarIcon(int paramInt)
  {
    findViewById(2131493276).setBackgroundResource(paramInt);
  }

  protected void setLeftBarText(String paramString)
  {
    ((Button)findViewById(2131492864).findViewById(2131493276)).setText(paramString);
  }

  protected void setRightBarIcon(int paramInt)
  {
    findViewById(2131493280).setBackgroundResource(paramInt);
  }

  protected void setRightBarText(int paramInt)
  {
    ((TextView)findViewById(2131493280)).setText(paramInt);
  }

  protected void showBarHome()
  {
    findViewById(2131492864).findViewById(2131493278).setVisibility(0);
  }

  protected void showBarHomeBtn(Boolean paramBoolean)
  {
    findViewById(2131492864).findViewById(2131493278).setVisibility(0);
    findViewById(2131492864).findViewById(2131493280).setVisibility(8);
    Button localButton = (Button)findViewById(2131492864).findViewById(2131493279);
    localButton.setVisibility(0);
    if (!paramBoolean.booleanValue())
      localButton.setBackgroundDrawable(null);
  }

  protected void showProgress(String paramString)
  {
    showProgress(paramString, "Please wait...");
  }

  protected void showProgress(String paramString1, String paramString2)
  {
    if (this.mProgressDialog != null)
      closeProgress();
    this.mProgressDialog = WidgetDialogHelper.showProgressDialog(paramString1, paramString2, true);
  }

  protected void unlock()
  {
    this.isLock.set(false);
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.app.AppTabActivity
 * JD-Core Version:    0.6.2
 */